package com.sc.nft.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.ecology.AdminPageUserRewardsRecordsVO;
import com.sc.nft.entity.vo.ecology.HatchRecordsRewardsDetailsVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserEcologyHatchRewardsRecords;
import com.sc.nft.mapper.UserEcologyHatchRewardsRecordsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 生态-孵化-用户奖励记录表(sc_user_ecology_hatch_rewards_records)数据DAO
 *
 * @author Sun
 * @since 2023-10-13 17:22:12
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserEcologyHatchRewardsRecordsDao extends ServiceImpl<UserEcologyHatchRewardsRecordsMapper, UserEcologyHatchRewardsRecords> {

    public List<HatchRecordsRewardsDetailsVO> hatchRecordsDetails(Long userId,Long userEcologyHatchRecordsId) {
        return baseMapper.hatchRecordsDetails(userId,userEcologyHatchRecordsId);
    }

    public Page<AdminPageUserRewardsRecordsVO> getPageUserRecordsRecords(Long id, Date startTime, Date endTime, Integer pageNo, Integer pageSize) {
        return baseMapper.getPageUserRecordsRecords(new Page<>(pageNo,pageSize),id,startTime,endTime);
    }

    public boolean getIsExistByUserIdAndRecordsId(Long userId, Long id) {
        return baseMapper.getIsExistByUserIdAndRecordsId(userId,id) > 0;
    }
}